<template>
  <div class="container">
    <!-- <img src="../assets/img/9.jpg" alt=""> -->
    <!--<slider speed='2000'></slider>-->
    <h3 class="alert alert-info">题目列表</h3>
    <table class="table table-bordered" style="margin-top: 80px">
      <thead style="text-align: center">
        <tr>
          <th>题目号</th>
          <th>作业名称</th>
          <th>班级</th>
          <th>题目类型</th>
          <th>题目数量</th>
          <th>创建时间</th>
          <th>结束时间</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(list, index) in lists" :key="index">
          <td>{{ list.topicId }}</td>
          <td><router-link to="/info">
            {{ list.homeworkName }}
          </router-link></td>

          <td>{{ list.className }}</td>
          <td>{{ list.topicType }}</td>
          <td>{{ list.topicNum }}</td>
          <td>{{ list.homeworkStartTime }}</td>
          <td>{{ list.homeworkEndTime }}</td>
          <td @click="del(index)" style="color: blue">
            <i class="icon icon-trash"><el-button type="text" @click="open">点击打开 Message Box</el-button></i>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script>
export default {
  name: "topic",
  data() {
    return {
      lists: [],
    };
  },
    

  mounted() {
    this.$axios
      .get("http://10.197.26.58:8001/gettopic")
      .then((response) => {
        this.lists = response.data.slice(0, 100);
        console.log(this.lists);
      })
      .catch(function (error) {
        //请求失败处理
        console.log(error);
      });
  },
};
</script>

